<template>
    <!-- 道闸弹框 -->
    <div class="security_barrier">
        <div class="content_header">
            <div
                v-for="(item, index) in state.timeList"
                :key="index"
                @click="timeValue = index"
                :class="timeValue === index ? 'isactive' : ''"
            >
                {{ item.name }}
            </div>
        </div>
        <div class="content_header_export">导出</div>
        <div class="search_listinput">
            <div class="">
                <el-input v-model="state.form.input1" placeholder="请输入车牌号"/>
            </div>
            <div class="searchSelect">
                <el-select v-model="state.form.region" placeholder="选择">
                    <el-option label="Zone one" value="shanghai"/>
                    <el-option label="Zone two" value="beijing"/>
                </el-select>
            </div>
            <div class="searchSelect" v-if="timeValue===0">
                <el-time-select
                    v-model="state.form.startTime"
                    :max-time="state.form.endTime"
                    class="mr-4"
                    placeholder="开始时间"
                    start="08:30"
                    step="00:15"
                    end="18:30"
                />
                -
                <el-time-select
                    v-model="state.form.endTime"
                    :min-time="state.form.startTime"
                    placeholder="结束时间"
                    start="08:30"
                    step="00:15"
                    end="18:30"
                />
            </div>
            <div class="searchSelect" v-else>
                <el-date-picker
                    v-model="state.form.value2"
                    type="datetimerange"
                    start-placeholder="开始时间"
                    end-placeholder="结束时间"
                    :default-time="defaultTime2"
                />
            </div>
            <div>
                <el-button type="primary">搜索</el-button>
            </div>
        </div>
        <div class="summarize">
            <div>
                <div>
                    <img src="@/assets/image/driveInicon.png" alt="">
                </div>
                <div>
                    <span>今日驶入车辆</span>
                    <span>538</span>
                </div>
            </div>
            <div>
                <div>
                    <img src="@/assets/image/driveOuticon.png" alt="">
                </div>
                <div>
                    <span>今日驶出车辆</span>
                    <span>538</span>
                </div>
            </div>
        </div>
        <div class="list">
            <div class="data_list">
                <div v-for="(item,index) in state.listdata" :key="index">
                    <div class="head">
                        <div>
                            <p>{{ item.name }}</p>
                            <p>{{ item.time }}</p>
                        </div>
                        <div>
                            <span>数据片段</span>
                        </div>
                    </div>
                    <div class="video">
                        <img src="@/assets/image/Snvideoback.png" alt="">
                    </div>
                </div>
            </div>
            <el-pagination
                v-model:currentPage="currentPage1"
                class="customPageClass"
                :page-size="1"
                small
                :background="true"
                :total="10"
            ></el-pagination>
        </div>
    </div>
</template>

<script setup lang="ts">
import {reactive, ref} from 'vue';

const timeValue = ref(0);
const currentPage1 = ref(1);
const defaultTime2 = ref([
    new Date(2000, 1, 1, 12, 0, 0),
    new Date(2000, 2, 1, 8, 0, 0),
])// '12:00:00', '08:00:00'
const state = reactive({
    timeList: [
        {
            name: '今日'
        },
        {
            name: '近7日'
        },
        {
            name: '近30天'
        }
    ],
    form: {
        input1: '',
        value2: '',
        region: '',
        startTime: '',
        endTime: ''
    },
    listdata:[{
        name:'鲁HJ3088',
        time:'2022/06/23 11:04:16'
    },{
        name:'鲁HJ3088',
        time:'2022/06/23 11:04:16'
    },{
        name:'鲁HJ3088',
        time:'2022/06/23 11:04:16'
    }]
});
</script>

<style scoped lang="scss">
@mixin input() {
    --el-input-border-color: transparent;
    --el-input-text-color: #fff;
}

@mixin wrapper() {
    background-color: rgba(255, 255, 255, .12);
    --el-input-border-color: rgba(255, 255, 255, .12);
}

::v-deep(.el-date-editor.el-input), ::v-deep( .el-date-editor.el-input__wrapper) {
    height: 40px;
}

::v-deep(.el-date-editor ) .el-range-input {
    color: #fff;
}


.searchSelect {
    ::v-deep(.el-input) {
        @include input();
    }

    ::v-deep(.el-input__wrapper) {
        background-color: rgba(255, 255, 255, .12);

        &:hover {
            box-shadow: none;
        }
    }

    ::v-deep(.el-popper .is-pure .is-light .el-select__popper),
    ::v-deep(.el-select-dropdown) {
        @include wrapper();
    }
}

::v-deep(.el-button) {
    height: 40px;
}

.security_barrier {
    padding: 16px 24px 45px;
    position: relative;

    .content_header {
        display: flex;
        justify-content: center;

        > div {
            width: 80px;
            padding: 6px 0;
            background: rgba(27, 147, 251, 0.2);
            margin-right: 8px;
            font-size: 14px;
            text-align: center;
            color: #ffffff;
            letter-spacing: 2px;
            cursor: pointer;

            &:last-child {
                margin-right: 0;
            }
        }

        .isactive {
            background: #1b93fb;
        }
    }

    .content_header_export {
        padding: 6px 0;
        width: 64px;
        background: #fbce05;
        text-align: center;
        border-radius: 4px;
        font-size: 14px;
        color: #08233a;
        letter-spacing: 2px;
        position: absolute;
        top: 16px;
        right: 24px;
        cursor: pointer;
    }

    .search_listinput {
        width: 100%;
        margin-top: 24px;
        display: flex;
        justify-content: space-between;

        > div {
            margin-right: 16px;

            &:nth-of-type(1), &:nth-of-type(2) {
                width: 20%;
            }

            &:nth-of-type(1) {
                ::v-deep(.el-input) {
                    @include input();
                }

                ::v-deep(.el-input__wrapper) {
                    @include wrapper();

                    &:hover {
                        box-shadow: none;
                    }
                }

            }

            ::v-deep(.el-input) {
                --el-input-height: 40px
            }

            &:nth-of-type(3) {
                width: calc(80% - 128px);
                display: flex;
                align-items: center;
                color: rgba(255, 255, 255, .2);

                > div {
                    display: inline-block;
                }

                ::v-deep(.el-icon) {
                    line-height: 40px;
                }

                ::v-deep(.el-date-editor) {
                    --el-input-border-color: transparent
                }

                ::v-deep(.el-date-editor ) .el-range-separator {
                    color: #fff
                }

            }

            &:nth-of-type(4) {
                width: 80px;
            }

            &:last-child {
                margin-right: 0;
            }
        }
    }

    .summarize {
        display: flex;
        align-items: center;
        margin-top: 22px;

        > div {
            padding: 0 35px 0 15px;
            display: flex;
            align-items: center;

            > div {
                &:nth-of-type(1) {
                    width: 27px;
                    height: 22px;
                    margin-right: 12px;

                    img {
                        width: 100%;
                        height: 100%;
                    }
                }

                &:nth-of-type(2) {
                    > span {
                        display: inline-block;
                        width: 100%;
                        color: #FFFFFF;
                        letter-spacing: 2px;
                        &:nth-of-type(1) {
                            font-size: 12px;
                        }
                        &:nth-of-type(2){
                            font-size: 20px;
                            font-family: PangMenZhengDao;
                        }
                    }
                }
            }
            &:nth-of-type(1) {
                border-right: 1px dashed rgba(255, 255, 255, .5);
                span{
                    &:nth-of-type(2){
                        background: linear-gradient(0deg, #2DF6A3 0%, #19F4F1 100%);
                        -webkit-background-clip: text;
                        -webkit-text-fill-color: transparent;
                    }
                }
            }

            &:nth-of-type(2) {
                margin-left: 15px;

                span{
                    &:nth-of-type(2){
                        background: linear-gradient(0deg, #FEDB35 0%, #FD894E 100%);
                        -webkit-background-clip: text;
                        -webkit-text-fill-color: transparent;
                    }
                }
            }
        }
    }
}

.list{
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.data_list{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;

    >div{
        width: calc(calc(100% / 3) - 6px);
        height:auto;
        .head{
            padding: 5px 10px;
            background: #0B3C66;
            display: flex;
            align-items: center;
            justify-content: space-between;
            >div{
                &:nth-of-type(1){
                    width: 60%;
                    display: flex;
                    flex-wrap: wrap;
                    p{
                        display: inline-block;
                        width: 100%;
                        &:nth-of-type(1){
                            font-size: 12px;
                            font-weight: 500;
                            color: #4FC2FF;
                            margin-bottom: 5px;letter-spacing: 2px;
                        }
                        &:nth-of-type(2){
                            font-size: 8px;
                            color: #D3E9FC;
                        }
                    }
                }
                &:nth-of-type(2){
                    width: 40%;
                    display: flex;
                    justify-content: flex-end;
                    cursor: pointer;
                    >span{
                        padding: 0 10px;
                        display: inline-block;
                        height: 20px;
                        line-height: 20px;
                        background: #1B93FB;
                        border-radius: 10px;
                        font-size: 12px;
                        color: #FFFFFF;
                        text-align: center;
                    }
                }
            }
        }
        .video{
            height: 150px;
            img{
                width: 100%;
                height: 100%;
            }
        }
    }
}
</style>
